<?php
class LoginIdentity extends CBaseUserIdentity{
	
	protected $_prototype;
	
	public function __construct($prototype){
		if ($prototype instanceof LoginAuth) {
			$this->setPrototype($prototype);
		}
	}
	
	public function setPrototype(LoginAuth $prototype){
		$this->_prototype = $prototype;
		return $this;
	}
	
	public function getPrototype(){
		return $this->_prototype;
	}
	
	public function authenticate()
	{
		$authenticate = $this->getPrototype()->authenticate();
		return $authenticate;
	}
	
	public function getId()
	{
		return $this->getPrototype()->primary;
	}
	
	
	public function getName()
	{
		return $this->getPrototype()->username;
	}
}